1. Field of the Invention
This invention relates to a data processing apparatus having stored therein a set of rules each in the form of a condition and an associated response, the condition portion of each rule requiring the presence of a specific behaviour and the apparatus comprising means for responding to any said condition being satisfied by generating the associated response.
2. Description of the Related Art
A known apparatus of this general kind is disclosed in an article by R. D. Hill entitled "Supporting Concurrency, Communication and Synchronism in Human-Computer Interactions--The Sassafras UIMS" in ACM Transactions on Graphics, Vol. 5 No. 3 (July 1986) pages 179-210. In this known apparatus, which takes the form of a user-interface management system (UIMS), each rule specifies a response to some external event, e.g. the keying in of a code, or an action to be taken when some state is entered. The condition portion of each rule is either the name of an event followed by a list of flags, or simply a list of flags. The action is a list of flags to raise, events to send, and assignments. All input to the processing part of the apparatus comes through a queue of incoming events (which may be generated within the system by the firing of rules or may be externally input). A rule is fired, i.e. the relevant associated response is generated, when all flags in the condition are raised and the event (if any) is at the head of the queue.
Processing proceeds in the known apparatus by repeating the following two steps:
1. Considering only those rules for which the condition part consists only of a list of flags PA1 2. Considering all the other rules do once
(a) identify and mark all rules that are firable given the current values of the flags, PA2 (b) fire all the marked rules. PA2 (a) identify and mark all rules that are firable given the current values of the flags and the token at the head of the input queue, PA2 (b) fire all the marked rules PA2 (c) delete the token at the head of the input queue.
It will be evident that more than one rule may be marked at one time; thus a single event may cause more than one rule to fire.